import request from '@/config/axios'

// ERP基础资料-箱型内外径设置 VO
export interface BaseBoxInnerOuterConfigVO {
  id: string // 主键 ID
  customerId: string // 客户 ID
  customerName: string // 客户名称
  boxTypeId: string // 箱型 ID
  boxTypeName: string // 箱型名称
  materialId: string // 材质 ID
  materialName: string // 材质名称
  length: number // 长度
  width: number // 宽度
  height: number // 高度
  length2: number // 长度2
  width2: number // 宽度2
  height2: number // 高度2
  fluteType: string // 楞型
}

// ERP基础资料-箱型内外径设置 API
export const BaseBoxInnerOuterConfigApi = {
  // 查询ERP基础资料-箱型内外径设置分页
  getBaseBoxInnerOuterConfigPage: async (params: any) => {
    return await request.get({ url: `/erp/base-box-inner-outer-config/page`, params })
  },

  // 查询ERP基础资料-箱型内外径设置详情
  getBaseBoxInnerOuterConfig: async (id: number) => {
    return await request.get({ url: `/erp/base-box-inner-outer-config/get?id=` + id })
  },

  // 获取所有客户
  getAllBaseCustomer: async () => {
    return await request.get({ url: `/erp/base-box-inner-outer-config/list-all-customer` })
  },
  
  // 获取所有材质
  getAllBaseMaterial: async () => {
    return await request.get({ url: `/erp/base-box-inner-outer-config/list-all-material` })
  },
    
  // 获取所有箱型
  getAllBaseBoxType: async () => {
    return await request.get({ url: `/erp/base-box-inner-outer-config/list-all-box-type` })
  },
  
  // 新增ERP基础资料-箱型内外径设置
  createBaseBoxInnerOuterConfig: async (data: BaseBoxInnerOuterConfigVO) => {
    return await request.post({ url: `/erp/base-box-inner-outer-config/create`, data })
  },

  // 修改ERP基础资料-箱型内外径设置
  updateBaseBoxInnerOuterConfig: async (data: BaseBoxInnerOuterConfigVO) => {
    return await request.put({ url: `/erp/base-box-inner-outer-config/update`, data })
  },

  // 删除ERP基础资料-箱型内外径设置
  deleteBaseBoxInnerOuterConfig: async (id: number) => {
    return await request.delete({ url: `/erp/base-box-inner-outer-config/delete?id=` + id })
  },

  // 导出ERP基础资料-箱型内外径设置 Excel
  exportBaseBoxInnerOuterConfig: async (params) => {
    return await request.download({ url: `/erp/base-box-inner-outer-config/export-excel`, params })
  }
}
